# -*- coding:utf-8 -*-
# 2013-08-13

import urllib, urllib2, cookielib


cookie = cookielib.CookieJar()
oper = urllib2.build_opener( urllib2.HTTPCookieProcessor(cookie) )
urllib2.install_opener(oper)
req = urllib2.Request('http://www.google.com')

res = urllib2.urlopen(req)
# res = urllib2.urlopen(req, data=urllib.urlencode({}), timeout=30)  # POST
print res.code
for i in cookie:
	print i
